function myInstanceOf(source, target) {
    if (
        typeof source != "object" ||
        source === null ||
        typeof target != "function"
    ) {
        return false;
    }
    let tmp = source;
    while (tmp) {
        if (tmp === target.prototype) {
            return true;
        }
        tmp = tmp.__proto__;
    }
    return false;
}

// console.log(myInstanceOf({}, Object))
// console.log(myInstanceOf(1, Number))
console.log(typeof String);
